
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<script src="../js/vue.min.js"></script>
		<script src="../js/vant.min.js"></script>
		<script src="../js/ajax.js"></script>
		<link rel="stylesheet" href="../css/index.css" />
		<script src="html5plus://ready"></script>
		<script src="../js/listener_other.js"></script>
		
		<title>修改密码</title>
	</head>
	<body placeholder="nihao">
		<div id="app">
			<van-row style="background-color:orangered; height:100px;line-height:46px;padding-top: 2%;">
			  <van-col span="2" offset="1" ><van-icon color="white" name="arrow-left" size="20px" style="margin-top: 29px;" /></van-col>
			 <van-col span="10" offset="4"><h2 style="color:white" >修改密码</h2></van-col>
			 
			</van-row>
			<van-row style="margin-top:3% ;">
			 	<van-col span="10" offset="2" >
			 	  	输入新密码：
			 	</van-col>
				<van-col span="10" offset="2" >
			 	  	<input type="password" placeholder="请输入新密码" id="phone" v-model="password1"  name="phone" style="border: none;" />
				</van-col>
			</van-row>
			<van-row style="margin-top:3% ;">
			 	<van-col span="10" offset="2" >
			 	  	再次输入密码：
			 	</van-col>
				<van-col span="10" offset="2" >
			 	  	<input type="password" placeholder="请再次输入新密码" id="phone" v-model="password2"  name="phone" style="border: none;" />
				</van-col>
			</van-row>
			
			 
			  <van-row style="margin-top:10% ;">
			 	  <van-col span="20" offset="2" >
			 	  	<van-button type="danger" @click="save" size="large">保存</van-button>
			 	  	</van-col>
				  
				 
			 </van-row>
			  
			

		</div>
		<script type="text/javascript">
		

			var vm = new Vue({

				el: "#app",

				data: {
					password1:"",
					password2:""
					
					

				},

				methods: {
					
					save: function(res) {
							if(this.password1==this.password2){
								ajax({
									url: "http://dsapi.ysd3g.com/api/ResetPassword",
									dataType: "jsonp",
									data: {
										phone: plus.webview.currentWebview().phone,
										password: vm.password
									},
									success(res) {
										if (res.Error) {
											vm.$toast.fail(res.Msg);
										} else{
											vm.$toast.success("修改成功");
											plus.webview.create("../personcenter/denglu.html","login").show();
										}
									}
								})
							}else{
								vm.$toast.fail("两次输入的密码不同");
							}
						
							
						
						
					}
				}

			});
		</script>
	</body>
</html>